<!DOCTYPE html>
<html>
<head>
    <title>抽奖配置</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
               <!-- <i-button type="warning" @click="opensignbuday"><i class="fa fa-pencil-square-o"></i>&nbsp;签到打卡日签到开奖</i-button>
                <i-button type="warning" @click="opensignbyweek"><i class="fa fa-pencil-square-o"></i>&nbsp;签到打卡周开奖</i-button>-->
                #if($shiro.hasPermission("lotteryconfig:info"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;查看</i-button>
                #end
                #if($shiro.hasPermission("lotteryconfig:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("lotteryconfig:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("lotteryconfig:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="lotteryConfig" :rules="ruleValidate" :label-width="80">
            <Form-item label="名称" prop="name">
                <i-input v-model="lotteryConfig.name" placeholder="名称"/>
            </Form-item>
            <Row>
                <i-col span="16">
                    <Form-item label="logo" prop="logo">
                        <i-input v-model="lotteryConfig.logo" placeholder="logo" readonly/>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../sys/oss/upload?prefix=product"
                                :format="['jpg','jpeg','png']"
                                max-size="2048"
                                :on-success="handleSuccessLogo" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeImageLogo">预览图片</i-button>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item label="URL地址" prop="url">
                <i-input v-model="lotteryConfig.url" placeholder="URL地址"/>
            </Form-item>
            <Form-item label="消费数量" prop="number">
                <i-input v-model="lotteryConfig.number" placeholder="消费数量"/>
            </Form-item>
            <Form-item label="类型" prop="type">
                <Radio-group v-model="lotteryConfig.type" placeholder="类型">
                    <Radio label="1">
                        <span>大转盘活动</span>
                    </Radio>
                    <Radio label="2">
                        <span>幸运转盘</span>
                    </Radio>
                    <Radio label="3">
                        <span>刮刮乐</span>
                    </Radio>
                    <Radio label="4">
                        <span>健康打卡</span>
                    </Radio>
                    <Radio label="5">
                        <span>周周乐</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="优先级" prop="priority">
                <i-input v-model="lotteryConfig.priority" placeholder="优先级"/>
            </Form-item>
            <Form-item label="用户编号逗号分隔" prop="user">
                <i-input v-model="lotteryConfig.user" placeholder="用户编号逗号分隔"/>
            </Form-item>
            <Form-item label="中奖级别" prop="level">
                <i-select v-model="lotteryConfig.level" placeholder="奖品级别">
                    <i-option :value="item" v-for="item in 20">{{item}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="中奖倍率" prop="power">
                <i-input v-model="lotteryConfig.power" placeholder="中奖倍率"/>
            </Form-item>
            <Form-item label="是否开启" prop="isOpen">
                <Radio-group v-model="lotteryConfig.isOpen">
                    <Radio label="1">
                        <span>是</span>
                    </Radio>
                    <Radio label="0">
                        <span>否</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/active/lotteryconfig.js?_${date.systemTime}"></script>
</body>
</html>